﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel.Composition;
using SonCa.SocialNetwork.Profiles.IPresenters;
using SonCa.SocialNetwork.Profiles.Presenters;
using Core.Interfaces;
using Core.DataAccess;

namespace SonCa.SocialNetwork.Web.Profiles.ASCX
{
    public partial class EditAvatar : System.Web.UI.UserControl, IUploadAvatar
    {        
        private UploadAvatarPresenter _presenter;        

        protected void Page_Load(object sender, EventArgs e)
        {
            _presenter = new UploadAvatarPresenter();            
            _presenter.Init(this);
        }

        public void ShowMessage(string Message)
        {
            lblMessage.Text = Message;
        }
        public void ShowApprovePanel()
        {
            //pnlCrop.Visible = false;
            pnlUpload.Visible = false;
            //pnlApprove.Visible = true;
        }

        public void ShowUploadPanel()
        {
            //pnlCrop.Visible = false;
            pnlUpload.Visible = true;
            //pnlApprove.Visible = false;
        }

        public void ShowCropPanel()
        {
            //pnlCrop.Visible = true;
            pnlUpload.Visible = false;
            //pnlApprove.Visible = false;
        }

        public void ShowAvatar(int accountID)
        {
            imgAvatar_uc.ImageUrl = "~/Images/ProfileAvatar/ProfileImage.aspx?AccountID=" + accountID.ToString();
        }                

        public void CloseDialog()
        {
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "close", "closeDialog();", true);
        }

        public void ShowInfo(Account account, WorkPlace workPlace)
        {

        }
    }
}